<template>
  <section class="market-wrapper nb-shadow">
    <se-content ref="search">
      <template>
        <se-form
          placeholder="搜索咨询顾问姓名"
          v-model="searchModel.param.advisorName"
          label="生产计划入库单"
        ></se-form>
        <se-form
          type="select"
          :options="returnCycleMethods"
          placeholder="搜索咨询顾问手机号"
          v-model="searchModel.param.advisorMobile"
          label="生产计划入库单"
        ></se-form>
        <se-form
          v-if=""
          type="select"
          placeholder="搜索产品类型"
          :options="typeOptions"
          v-model="searchModel.param.type"
          label="生产计划入库单"
        ></se-form>
        <se-form
          placeholder="搜索保单受理开始日期"
          v-model="searchModel.param.startAcceptDate"
          label="生产计划入库单"
        ></se-form>
        <se-form
          placeholder="搜索保单受理结束日期"
          v-model="searchModel.param.endAcceptDate"
          label="生产计划入库单"
        ></se-form>
      </template>
      <template slot="button">
        <el-button plain  type="primary" @click="query">查询</el-button>
      </template>
      <template slot="button">
        <el-button plain @click="query">重置</el-button>
      </template>
    </se-content>
    <template>
      <nb-button type="primary" @click="create">新增</nb-button>
    </template>
    <activity-list
      status="1"
      ref="readyList"
      @look="lookDetail"
      @over="over"
      @costOver="costOver"
    ></activity-list>
</section>
</template>

<script>
  import ActivityList from './activityList.vue'
  import ElCreate from './create.vue'
  import Mixin from '@/common/mixin'
  import SeContent from '@/components/se-content.vue'
  import SeForm from '@/components/se-form.vue'

  export default {
    data () {
      return {
        searchModel: {
          param: {
            advisorName: '',
            advisorMobile: '',
            deptCode: '',
            type: '',
            startAcceptDate: '',
            endAcceptDate: '',
            startUnderwriteDate: '',
            endUnderwriteDate: '',
            startReceiptDate: '',
            endReceiptDate: ''
          }
        },
        length: 0,
        row: null,
        batchOptions: [],
        returnCycleMethods: [],
        typeOptions: []
      }
    },
    components: {
      ActivityList,
      ElCreate,
      SeContent,
      SeForm
    },
    mixins: [Mixin],
    methods: {
      query () {

      },
      clickRight (type, row) {
        if (this.activeName === '1') {
          this.$refs.readyList.clickRight({type: type, row: row || this.row})
        } else {
          this.$refs.noneList.clickRight({type: type, row: row || this.row})
        }
      },
      create (id) {
        this.$router.push({
          name: 'createMarket',
          params: {
            id: id
          }
        })
      },
      costOver () {
        if (this.$store.state.layout.isShowDetial) {
          this.$refs.marketDetail.over(true)
        }
      },
      lookDetail (row) {
        this.row = row
        this.handleEdit(this.$refs.marketDetail.showDetail, row.id)
      },
      closeDetail () {
        this.handleEdit(this.$refs.marketDetail.closeDetail)
      },
      over (type) {
        this.length = 0
        this.getNumber()
        if (this.$store.state.layout.isShowDetial) {
          if (type === 'del') {
            this.$refs.marketDetail.closeDetail()
          } else {
            this.$refs.marketDetail.showDetail(this.row.id)
          }
        }
      }
    },
    mounted () {
    }
  }
</script>

<style lang="scss">
.market-wrapper{
  background: white;
  .el-tabs__active-bar{
    /*left: 24px !important;*/
  }
}
</style>
